> ## Documentation Index
> Fetch the complete documentation index at: https://sequence-0fb8d9e6-api_docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# useGetTransactionHistorySummary

> Hook for fetching and combining transaction history across multiple chains

## Import

```tsx theme={null}
import { useGetTransactionHistorySummary } from '@0xsequence/hooks'
```

## Usage

```tsx theme={null}
import { useGetTransactionHistorySummary } from '@0xsequence/hooks'
import { useAccount } from 'wagmi'

function TransactionHistory() {
  const { address } = useAccount()
  
  const {
    data: transactions,
    isLoading,
    isError,
    error
  } = useGetTransactionHistorySummary({
    accountAddress: address || '',
    chainIds: [1, 137] // Fetch from Ethereum and Polygon
  })

  if (isLoading) return <div>Loading...</div>
  if (isError) return <div>Error: {error.message}</div>

  return (
    <div>
      {transactions?.map(tx => (
        <div key={tx.txnHash}>
          <h3>Transaction: {tx.txnHash}</h3>
          <p>Chain: {tx.chainId}</p>
          <p>Time: {new Date(tx.timestamp).toLocaleString()}</p>
          {tx.transfers?.map((transfer, index) => (
            <div key={index}>
              <p>From: {transfer.from}</p>
              <p>To: {transfer.to}</p>
              <p>Value: {transfer.value}</p>
            </div>
          ))}
        </div>
      ))}
    </div>
  )
}
```

## Return Type: `UseQueryResult<Transaction[]>`

The hook returns all properties from React Query's `UseQueryResult` with transaction data. Here's the detailed structure:

```tsx theme={null}
interface TxnTransfer {
    transferType: TxnTransferType;
    contractAddress: string;
    contractType: ContractType;
    from: string;
    to: string;
    tokenIds?: Array<string>;
    amounts: Array<string>;
    logIndex: number;
    contractInfo?: ContractInfo;
    tokenMetadata?: {
        [key: string]: TokenMetadata;
    };
}

interface Transaction {
  txnHash: string
  chainId: number
  timestamp: string
  blockNumber: number
  blockHash: string
  metaTxnID?: string
  transfers?: Array<TxnTransfer>
}
```

### Properties

#### data

`Transaction[] | undefined`

Array of transactions from all specified chains, sorted by timestamp (newest first). Each transaction includes:

* `txnHash`: Transaction hash
* `chainId`: Chain ID where transaction occurred
* `timestamp`: Transaction timestamp
* `blockNumber`: Block number where transaction was mined
* `blockHash`: Hash of the block
* `metaTxnID`: Optional meta transaction ID
* `transfers`: Array of transfer objects with normalized addresses

#### isLoading

`boolean`

Loading state for the initial data fetch.

#### isError

`boolean`

Error state indicating if the query failed.

#### error

`Error | null`

Any error that occurred during data fetching.

## Parameters

The hook accepts two parameters:

### args: `GetTransactionHistorySummaryArgs`

```tsx theme={null}
interface GetTransactionHistorySummaryArgs {
  accountAddress: string
  chainIds: number[]
}
```

| Parameter        | Type       | Description                                   |
| ---------------- | ---------- | --------------------------------------------- |
| `accountAddress` | `string`   | The account address to fetch transactions for |
| `chainIds`       | `number[]` | Array of chain IDs to fetch transactions from |

### options: `HooksOptions`

```tsx theme={null}
interface HooksOptions {
  disabled?: boolean
  retry?: boolean
}
```

| Parameter  | Type      | Description                                             |
| ---------- | --------- | ------------------------------------------------------- |
| `disabled` | `boolean` | (Optional) Disable the query from automatically running |
| `retry`    | `boolean` | (Optional) Whether to retry failed queries              |
